

#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>

#include "stm32f4xx.h"
#include "delay.h"

#include "bsp_gpio.h"
#include "stm32_it.h"
#include "StateMachine.h"
#include "main.h"
#include "delay.h"
#include "key.h"
#include "app.h"
#include "ws2812b.h"

extern uint16_t _1s_ticks;
double x = -M_PI;
float y = 0.0f;
double some_constant = 128.0f;
int main(void)
{
	SystemInit();

	delay_init(168);

	bsp_gpio_init();

	delay_ms(10);

	btn_init();

	Interrupt_Init();
	
	while (1)
	{
		if(_1s_ticks >= 1)
		{
			_1s_ticks = 0;
			y = calculate_y(x, some_constant);
			x+=0.001f;
			if(x > M_PI)
			{
				x = -M_PI;
			}
		}

	}
}
